package win.larryzeal.spring.jms.config.listener;

import org.springframework.jms.listener.adapter.MessageListenerAdapter;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Map;

/**
 * Created by 张少昆 on 2017/8/5.
 */
@Component
public class MessageListenerOneImpl extends MessageListenerAdapter implements MessageListenerOne {
    // @PostConstruct
    public void init(){
        super.setDefaultListenerMethod(MessageListenerAdapter.ORIGINAL_DEFAULT_LISTENER_METHOD);//默认是这个  handleMessage，可以修改
    }

    @Override
    public void handleMessage(String message){
        System.out.println("MessageListenerAdapter bean 收到String msg: " + message);
    }

    @Override
    public void handleMessage(Map message){
        System.out.println("MessageListenerAdapter bean 收到Map msg: " + message);
    }

    @Override
    public void handleMessage(byte[] message){
        System.out.println("MessageListenerAdapter bean 收到byte[] msg: " + message);
    }

    @Override
    public void handleMessage(Serializable message){
        System.out.println("MessageListenerAdapter bean 收到Serializable msg: " + message);
    }
}
